doctype html
html(lang=CHART_LOCALE)
  head
    meta(charset="UTF-8")
    meta(name="viewport", content="width=device-width, initial-scale=1.0")
    style!=CSS
    | !{CHART_HEAD}

  body
    div(class="dw-chart chart" class=CHART_CLASS id="__svelte-dw")
      | !{CHART_HTML}

    //- https://v8.dev/blog/cost-of-javascript-2019#json
    script.
      window.__DW_SVELTE_PROPS__ = JSON.parse(!{__DW_SVELTE_PROPS__});
      window.__DW_SVELTE_PROPS__.isStylePlain = /[?&]plain=1/.test(window.location.search);
      window.__DW_SVELTE_PROPS__.isStyleStatic = /[?&]static=1/.test(window.location.search);
      if (/[?&]logo=(auto|on|off)/.test(window.location.search)) {
        window.__DW_SVELTE_PROPS__.forceLogo = (window.location.search).match(/[?&]logo=(auto|on|off)/)[1];
      }
      window.__DW_SVELTE_PROPS__.logoId = new URLSearchParams(window.location.search).get('logoId');
    each src in DEPS
      script(src=src)

    script.
      window.parent.postMessage('datawrapper:vis:reload', '*');

    script(src=POLYFILL_SCRIPT)

    each src in LIBRARIES
      script(src=src)

    script(src=VIS_SCRIPT)

    script(src=MAIN_SCRIPT)
